/**
 * 客户信息表 api 封装
 *
 * @Author:    lmabbe
 * @Date:      2025-06-24 14:55:52
 * @Copyright  lmabbe
 */
import { getRequest, postRequest } from '/@/lib/axios';

export const customerInfoApi = {
  /**
   * 查询所有  @author  lmabbe
   */
  customerAll: (param) => {
    return getRequest('basic/customerInfo/all');
  },

  /**
   * 分页查询  @author  lmabbe
   */
  queryPage: (param) => {
    return postRequest('basic/customerInfo/queryPage', param);
  },

  /**
   * 增加  @author  lmabbe
   */
  add: (param) => {
    return postRequest('basic/customerInfo/add', param);
  },

  /**
   * 修改  @author  lmabbe
   */
  update: (param) => {
    return postRequest('basic/customerInfo/update', param);
  },

  changeDisable: (customerCode, isDisable) => {
    return postRequest(`basic/customerInfo/${customerCode}/changeDisable/${isDisable}`);
  },

  /**
   * 删除  @author  lmabbe
   */
  delete: (id) => {
    return getRequest(`basic/customerInfo/delete/${id}`);
  },

  /**
   * 批量删除  @author  lmabbe
   */
  batchDelete: (idList) => {
    return postRequest('basic/customerInfo/batchDelete', idList);
  },

  /**
   * 增加  @author  lmabbe
   */
  setParseOriFacBarcode: (param) => {
    return postRequest('basic/customer/setParseOriFacBarcode', param);
  },

  /**
   * 增加  @author  lmabbe
   */
  getParseOriFacBarcode: (id) => {
    return getRequest(`basic/customer/getParseOriFacBarcode/${id}`);
  },

  /**
   * 增加  @author  lmabbe
   */
  setParseBom: (param) => {
    return postRequest('basic/customer/setParseBom', param);
  },

  /**
   * 增加  @author  lmabbe
   */
  getParseBom: (id) => {
    return getRequest(`basic/customer/getParseBom/${id}`);
  },

  /**
   * 解析原厂条码  @author  lmabbe
   */
  parseOriFacBarcode: (param) => {
    return getRequest(`basic/customer/parseOriFacBarcode`, param);
  },
};
